package com.bookmall.controller;

import com.bookmall.pojo.TbBookUser;
import com.bookmall.pojo.vo.Result;
import com.bookmall.service.SignOnSerivce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author tx
 * @version 1.0
 * @date 2020/3/9 20:10
 */
@RestController
@RequestMapping("/sign")
public class SignController {

    @Autowired
    private SignOnSerivce signOnSerivce;

    @RequestMapping("/sign")
    @ResponseBody
    public Result sign(@RequestBody TbBookUser tbBookUser){
        Result result=new Result();
        Integer sign = signOnSerivce.sign(tbBookUser);
        if(sign==0){
            result.setSuccess(false);
            result.setMessage("注册失败");
            return result;
        }
        result.setObject(true);
        result.setMessage("注册成功");
        return result;
    }

}
